<?php /*a:2:{s:81:"/www/wwwroot/dj.sdwanyue.com/public/themes/admin_simpleboot3/admin/shop/edit.html";i:1616840422;s:79:"/www/wwwroot/dj.sdwanyue.com/public/themes/admin_simpleboot3/public/header.html";i:1610676092;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->


    <link href="/themes/admin_simpleboot3/public/assets/themes/<?php echo cmf_get_admin_style(); ?>/bootstrap.min.css" rel="stylesheet">
    <link href="/themes/admin_simpleboot3/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="/static/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }
    </style>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "/",
            WEB_ROOT: "/",
            JS_ROOT: "static/js/",
            APP: '<?php echo app('request')->module(); ?>'/*当前应用名*/
        };
    </script>
    <script src="/themes/admin_simpleboot3/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="/static/js/wind.js"></script>
    <script src="/themes/admin_simpleboot3/public/assets/js/bootstrap.min.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip({
                container:'body',
                html:true,
            });
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <?php if(APP_DEBUG): ?>
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    <?php endif; ?>
</head>
<body>
<div class="wrap">


    <!--商品编辑页-->

    <ul class="nav nav-tabs">
        <li><a href="<?php echo url('shop/goods'); ?>">商品</a></li>
        <li class="active"><a href="<?php echo url('shop/edit'); ?>">编辑</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="<?php echo url('shop/editPost'); ?>">
        <div class="form-group">
            <label for="input-name" class="col-sm-2 control-label">标题<span class="form-required">*</span></label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-name" name="title" value="<?php echo $result['title']; ?>">
            </div>
        </div>

        <div class="form-group">
            <label for="input-name" class="col-sm-2 control-label">价值积分<span class="form-required">*</span></label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="input-score" name="score" value="<?php echo $result['score']; ?>">
            </div>
        </div>

        <div class="form-group">
            <label for="thumbnail" class="col-sm-2 control-label"><span class="form-required">*</span>图片</label>
            <div class="col-md-6 col-sm-10">
                <input type="hidden" name="thumb" id="thumbnail"  value="<?php echo $result['thumb']; ?>">
                <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
                    <?php if($result['thumb'] != ''): ?>
                        <img src="<?php echo get_upload_path($result['thumb']); ?>"
                             id="thumbnail-preview"
                             style="cursor: pointer;max-width:100px;max-height:100px;"/>
                        <?php else: ?>
                        <img src="/themes/admin_simpleboot3/public/assets/images/default-thumbnail.png"
                             id="thumbnail-preview"
                             style="cursor: pointer;max-width:100px;max-height:100px;"/>
                    <?php endif; ?>

                </a>
                <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
            </div>
        </div>

        <div class="form-group">
            <label for="" class="col-sm-2 control-label"><span class="form-required">*</span>介绍图(可多张)</label>
            <div class="col-md-6 col-sm-10">
                <ul id="photos" class="pic-list list-unstyled form-inline"></ul>
                <a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');"
                   class="btn btn-default btn-sm">选择图片</a>

            </div>
        </div>

        <div class="form-group">
            <label for="input-content" class="col-sm-2 control-label"><span class="form-required">*</span>简介</label>
            <div class="col-md-6 col-sm-10">
                <textarea class="form-control" id="input-content" name="content"><?php echo !empty($result['content']) ? $result['content'] : ''; ?></textarea>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="hidden" class="form-control" name="id" value="<?php echo $result['id']; ?>">
                <button type="submit" class="btn btn-primary js-ajax-submit"><?php echo lang('EDIT'); ?></button>
                <a class="btn btn-default" href="<?php echo url('shop/goods'); ?>"><?php echo lang('BACK'); ?></a>
            </div>
        </div>
    </form>
</div>
<script src="/static/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="/static/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/static/js/ueditor/ueditor.all.min.js"></script>

<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="multi_thumb[]" value="{filepath}">
        <img id="photo-{id}-preview" src="{url}" style="height:86px;width: 106px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>

<script type="text/javascript">

    $(function () {
        editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
        try {
            editorcontent.sync();
        } catch (err) {
        }

        $('#more-template-select').val("<?php echo (isset($post['more']['template']) && ($post['more']['template'] !== '')?$post['more']['template']:''); ?>");
    });


    var map;
    // 点击开启定位时显示地图
    $("input[name='is_location']").click(function () {
        if (this.value === '1') {
            $(".check-location").show();
            init();
        }
    });

    //点击关闭定位时移除地图元素
    $("#close-location").click(function () {
        $(".check-location").hide();
        $('#mapContainer').children().remove();
    });
    $(".btn-cancel-thumbnail").click(function(){
        $("#thumbnail-preview").attr('src','/themes/admin_simpleboot3/public/assets/images/default-thumbnail.png');
        $("#thumbnail").val('');
    });


</script>
</body>
</html>